package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.NursingProject;
import com.zzyl.vo.NursingProjectVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @Description NursingProjectMapper
 * @Author songyu
 * @Date 2024-10-15
 */
@Mapper
public interface NursingProjectMapper {

    /**
     * 根据条件查询护理项目列表
     * @param name
     * @param status
     * @return
     * 注意：当前中州养老项目与mybatis有冲突，所以如果方法参数大于1个必须给参数起别名，否则无法映射
     */
    Page<NursingProjectVo> findByCondition(@Param("name") String name,
                                           @Param("status") Integer status);

    /**
     * 新增护理项目
     * @param nursingProject
     */
    void insert(NursingProject nursingProject);

    /**
     * 根据id查询护理项目
     * @param id
     * @return
     */
    @Select("select * from nursing_project where id = #{id}")
    NursingProjectVo findById(Long id);

    /**
     * 修改护理项目
     * @param nursingProject
     */
    void update(NursingProject nursingProject);
}
